/*
 * @Author: your name
 * @Date: 2020-04-29 17:37:40
 * @LastEditTime: 2020-06-05 11:35:27
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ZfjdWebMainFramePlugin\src\assets\js\headerLabelWidth.js
 */ 
export default () => {
    let labelWidthList = 0;
    let items = document.querySelectorAll('.reverse_header .el-form-item');
    items.forEach((item, idx) => {
        let labelWidth = item.querySelector('.el-form-item__label') &&
                            item.querySelector('.el-form-item__label').clientWidth || 0;
        let originalWidth = labelWidthList[idx] || 0;
        if(labelWidth > labelWidthList){
            labelWidthList = labelWidth;
        }
    })
   
    let lists = document.querySelectorAll('.reverse_header .el-form-item');
    lists.forEach((list, idx) => {
        if(list.querySelector('.el-form-item__label')){
            list.querySelector('.el-form-item__label').style.width = labelWidthList + 'px';
        }
    })
  
}